CopyBank
CopyBank SrcBank, DestBank
 
Parameters:

    SrcBank = The index of the bank you wish to copy
    DestBank = The index of a free bank you wish to copy to
Returns: NONE
 

      CopyBank duplicates the contents of one memory bank to another. While CopyBank expects you to provide it with the index of destination bank, the destination bank can either be created by you, or it will create it for you prior to copying.



FACTS:


      * After copying the destination bank will be identical to the source.




Mini Tutorial:



  
; Create bank #10 with 15 bytes in it
  CreateBank 10,15
  
; fill and display the source bank
  Print "Showing Contents of Bank 10"
  For lp=0 To GetBankSize(10)-1
     PokeBankByte 10,lp,100+lp
     Print PeekBankByte(10,lp)
  Next
  
; Make a Copy bank #10 to Bank #20
  CopyBank 10,20
  
  
; Display the cloned (copied) bank
  Print "Showing Contents of Bank 20"
  For lp=0 To GetBankSize(20)-1
     Print PeekBankByte(20,lp)
  Next
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  


This example would output.

  
  Showing Contents of Bank 10
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  Showing Contents of Bank 20
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  
  
  
  

 
Related Info: CopyBankBytes | CopyMemory | CreateBank | GetBankPtr | GetBankSize | NewBank :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com